package sample.boot.metrics;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.MeterBinder;

import org.springframework.stereotype.Component;

/**
 * Created on 2020/8/7
 */
@Component
public class MyMetrics2 implements MeterBinder {

	private Counter counter;

	public void foo() {
		counter.increment();
	}

	public void bindTo(MeterRegistry meterRegistry) {
		counter = meterRegistry.counter("demo.counter2");
	}
}
